package client.backend.user;

import java.io.IOException;

/**
 * UserInformation is a singleton class used to store user information.
 *
 */
public class UserInformation {
	private User user;
	private static UserInformation instance = null;
	
	/**
	 * Generic constructor, sets user.
	 * @throws IOException
	 */
	public UserInformation() throws IOException{
		user = new User();
	}
	
	/**
	 * Getter method for user.
	 * @return	User.
	 */
	public User getUser(){
		return user;
	}
	
	/**
	 * Singleton method.
	 * @return	Instance of this class.
	 */
	public static UserInformation getInstance(){
		if (instance == null) {
			try {
				instance = new UserInformation();
			} catch (IOException e) {
				e.printStackTrace();
				instance = null;
			}
		}
		return instance;
	}
}
